package Date1204;

import java.util.Arrays;
import java.util.Collections;


public class Demo4 {
    public static void main(String[] args) {
        Integer[] n = {21,1,201,12};
        Arrays.sort(n);
        // Arrays.sort(n);

        for(int i=0;i<n.length;i++){

            System.out.print(n[i]+" ");
        }
        System.out.println();
        System.out.println(Arrays.toString(n));//从小到大排序
        Arrays.sort(n,Collections.reverseOrder());
        System.out.println(Arrays.toString(n));//从大到小排序
        
    }
}
